﻿using System;
using System.Runtime.Serialization;

namespace Rogue
{
    // a bodypart once it's removed from an entity who owned it, so we can throw it around.
    // should it be an Item instead (ie. inventory item?)
    [Serializable]
    public class SeveredBodyPart : Entity
    {
        Entity m_ExOwner;

        // we can access the owner in the constructor, but after this it's set null.
        public SeveredBodyPart(BodyPart a_BodyRoot, Entity a_ExOwner)
            : base()
        {
            m_BodyRoot = a_BodyRoot;
            m_ExOwner = a_ExOwner;
            m_sName = m_ExOwner.Name + "'s severed " + m_BodyRoot.GetLocationAndName();
            m_IsAlive = false;
        }

        public override DetailWindowImages GetDetailWindowImages()
        {
            return m_ExOwner.GetDetailWindowImages();
        }

        #region Serialization
        public SeveredBodyPart(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            // Nothing
        }
        #endregion
    };
}
